//
//  CustomView.h
//  alertViewDemo
//
//  Created by 金狗 on 2019/3/13.
//  Copyright © 2019 金狗. All rights reserved.
//

#import <UIKit/UIKit.h>
@protocol ActionSheetDelegate;

typedef void(^AlertResult)(NSInteger index);
typedef void(^ActionSheetBlock)(NSInteger buttonIndex);


NS_ASSUME_NONNULL_BEGIN

@interface CustomView : UIView

@property (nonatomic, copy) AlertResult resultIndex;
@property (nonatomic, weak) id<ActionSheetDelegate>delegate;

- (instancetype)initWithTitle:(NSString *)title message:(NSString *)message prompt:(nullable NSString *)prompt sureBtn:(NSString *)sureTitle cancleBtn:(nullable NSString *)cancleTitle size:(int)size;

- (instancetype)initWithTitle:(NSString *)title message:(NSString *)message;

- (void)showXLAlertView;


- (instancetype)initWithTitle:(nullable NSString *)title cancelButtonTitle:(nullable NSString *)cancelButtonTitle otherButtonTitles:(nullable NSArray *)otherButtonTitles actionSheetBlock:(ActionSheetBlock) actionSheetBlock;
- (void)showSheetView;

@end

#pragma mark - ActionSheet delegate

@protocol ActionSheetDelegate <NSObject>

@optional

- (void)actionSheet:(CustomView *)actionSheet didClickedButtonAtIndex:(NSInteger)buttonIndex;

@end
NS_ASSUME_NONNULL_END
